/*
 * Copyright (C) 2021 Freie Universität Berlin
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

#include <limits.h>

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "embUnit.h"
#include "crypto/ciphers.h"
#include "crypto/modes/ccm.h"
#include "tests-crypto.h"

/**
 * AES CCM DVTP test vectors (SP 800-38C) for 128 bit keys.
 * https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/cavp-testing-block-cipher-modes
 */

static const size_t nonce_and_len_encoding_size = 15;

/* Alen = 0, Plen = 0, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_0_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_0_KEY[] = {
    0x4a, 0xe7, 0x01, 0x10, 0x3c, 0x63, 0xde, 0xca,
    0x5b, 0x5a, 0x39, 0x39, 0xd7, 0xd0, 0x59, 0x92,
};
static const size_t TEST_DVPT128_GROUP_0_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_0_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_0_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_0_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_0_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_0_EXPECTED[] = {
    0x02, 0x20, 0x9f, 0x55,
};
static const size_t TEST_DVPT128_0_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_0_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_0_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_4_NONCE[] = {
    0x05, 0xe1, 0x6f, 0x0f, 0x42, 0xa6, 0xf4,
};
static const size_t TEST_DVPT128_4_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_4_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_4_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_4_EXPECTED[] = {
    0xf0, 0x9c, 0x29, 0x86,
};
static const size_t TEST_DVPT128_4_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_4_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_4_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_11_NONCE[] = {
    0xa9, 0xdf, 0x4f, 0x37, 0x84, 0x7e, 0x1f,
};
static const size_t TEST_DVPT128_11_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_11_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_11_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_11_EXPECTED[] = {
    0x19, 0x86, 0x7a, 0xa5,
};
static const size_t TEST_DVPT128_11_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_11_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_11_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_12_NONCE[] = {
    0x11, 0xdf, 0x57, 0xfc, 0xd1, 0x31, 0xe9,
};
static const size_t TEST_DVPT128_12_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_12_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_12_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_12_EXPECTED[] = {
    0x3b, 0x39, 0x2a, 0x52,
};
static const size_t TEST_DVPT128_12_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_12_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_12_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_13_NONCE[] = {
    0x89, 0x0f, 0xff, 0x56, 0xd1, 0x0d, 0xc0,
};
static const size_t TEST_DVPT128_13_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_13_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_13_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_13_EXPECTED[] = {
    0x1c, 0x5e, 0x47, 0xe0,
};
static const size_t TEST_DVPT128_13_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_13_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_13_INPUT_LEN = 0;

/* Alen = 0, Plen = 0, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_1_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_1_KEY[] = {
    0x4b, 0xb3, 0xc4, 0xa4, 0xf8, 0x93, 0xad, 0x8c,
    0x9b, 0xdc, 0x83, 0x3c, 0x32, 0x5d, 0x62, 0xb3,
};
static const size_t TEST_DVPT128_GROUP_1_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_15_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_15_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_15_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_15_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_15_EXPECTED[] = {
    0x75, 0xd5, 0x82, 0xdb, 0x43, 0xce, 0x9b, 0x13,
    0xab, 0x4b, 0x6f, 0x7f, 0x14, 0x34, 0x13, 0x30,
};
static const size_t TEST_DVPT128_15_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_15_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_15_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_19_NONCE[] = {
    0x05, 0xe1, 0x6f, 0x0f, 0x42, 0xa6, 0xf4,
};
static const size_t TEST_DVPT128_19_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_19_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_19_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_19_EXPECTED[] = {
    0xe2, 0xe8, 0x7c, 0xa8, 0x25, 0x23, 0xcc, 0xfe,
    0xb4, 0x16, 0xb4, 0x2a, 0xf9, 0xd9, 0xaa, 0xdc,
};
static const size_t TEST_DVPT128_19_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_19_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_19_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_26_NONCE[] = {
    0xa9, 0xdf, 0x4f, 0x37, 0x84, 0x7e, 0x1f,
};
static const size_t TEST_DVPT128_26_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_26_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_26_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_26_EXPECTED[] = {
    0x0e, 0x15, 0x0a, 0xf4, 0x22, 0xf6, 0xda, 0x23,
    0x8b, 0xb4, 0x76, 0x81, 0x0b, 0x2d, 0x5b, 0xc2,
};
static const size_t TEST_DVPT128_26_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_26_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_26_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_27_NONCE[] = {
    0x11, 0xdf, 0x57, 0xfc, 0xd1, 0x31, 0xe9,
};
static const size_t TEST_DVPT128_27_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_27_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_27_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_27_EXPECTED[] = {
    0x8e, 0x11, 0x50, 0x75, 0x6f, 0xf3, 0xa7, 0x33,
    0xa1, 0x27, 0x44, 0x70, 0xf0, 0x72, 0xb7, 0x4c,
};
static const size_t TEST_DVPT128_27_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_27_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_27_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_28_NONCE[] = {
    0x89, 0x0f, 0xff, 0x56, 0xd1, 0x0d, 0xc0,
};
static const size_t TEST_DVPT128_28_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_28_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_28_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_28_EXPECTED[] = {
    0xa1, 0xf7, 0x0d, 0xf3, 0xfa, 0x9c, 0xfe, 0xb9,
    0x5f, 0x86, 0x9b, 0x3f, 0xe0, 0x84, 0x66, 0xe0,
};
static const size_t TEST_DVPT128_28_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_28_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_28_INPUT_LEN = 0;

/* Alen = 0, Plen = 0, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_2_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_2_KEY[] = {
    0x4b, 0xb3, 0xc4, 0xa4, 0xf8, 0x93, 0xad, 0x8c,
    0x9b, 0xdc, 0x83, 0x3c, 0x32, 0x5d, 0x62, 0xb3,
};
static const size_t TEST_DVPT128_GROUP_2_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_30_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_30_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_30_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_30_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_30_EXPECTED[] = {
    0x90, 0x15, 0x6f, 0x3f,
};
static const size_t TEST_DVPT128_30_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_30_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_30_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_34_NONCE[] = {
    0x93, 0x5c, 0x1e, 0xf3, 0xd4, 0x03, 0x2f, 0xf0,
    0x90, 0xf9, 0x11, 0x41, 0xf3,
};
static const size_t TEST_DVPT128_34_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_34_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_34_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_34_EXPECTED[] = {
    0x1b, 0xc8, 0x2b, 0x3d,
};
static const size_t TEST_DVPT128_34_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_34_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_34_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_41_NONCE[] = {
    0xd0, 0xa1, 0x50, 0x8f, 0xde, 0xfc, 0xf5, 0xbe,
    0x30, 0xa4, 0x59, 0xb8, 0x13,
};
static const size_t TEST_DVPT128_41_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_41_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_41_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_41_EXPECTED[] = {
    0x36, 0xa3, 0x7a, 0x59,
};
static const size_t TEST_DVPT128_41_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_41_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_41_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_42_NONCE[] = {
    0x53, 0x81, 0xa6, 0x1b, 0x44, 0x9d, 0xc6, 0xa4,
    0x2a, 0xa4, 0xc7, 0x9b, 0x95,
};
static const size_t TEST_DVPT128_42_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_42_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_42_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_42_EXPECTED[] = {
    0xdb, 0xa0, 0x2a, 0x36,
};
static const size_t TEST_DVPT128_42_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_42_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_42_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_43_NONCE[] = {
    0xc5, 0x54, 0x30, 0xf2, 0xda, 0x06, 0x87, 0xea,
    0x40, 0x31, 0x38, 0x84, 0xab,
};
static const size_t TEST_DVPT128_43_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_43_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_43_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_43_EXPECTED[] = {
    0x25, 0xdc, 0xb3, 0xc5,
};
static const size_t TEST_DVPT128_43_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_43_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_43_INPUT_LEN = 0;

/* Alen = 0, Plen = 0, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_3_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_3_KEY[] = {
    0x19, 0xeb, 0xfd, 0xe2, 0xd5, 0x46, 0x8b, 0xa0,
    0xa3, 0x03, 0x1b, 0xde, 0x62, 0x9b, 0x11, 0xfd,
};
static const size_t TEST_DVPT128_GROUP_3_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_45_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_45_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_45_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_45_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_45_EXPECTED[] = {
    0xfb, 0x04, 0xdc, 0x5a, 0x44, 0xc6, 0xbb, 0x00,
    0x0f, 0x24, 0x40, 0xf5, 0x15, 0x43, 0x64, 0xb4,
};
static const size_t TEST_DVPT128_45_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_45_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_45_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_49_NONCE[] = {
    0x93, 0x5c, 0x1e, 0xf3, 0xd4, 0x03, 0x2f, 0xf0,
    0x90, 0xf9, 0x11, 0x41, 0xf3,
};
static const size_t TEST_DVPT128_49_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_49_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_49_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_49_EXPECTED[] = {
    0x3d, 0xac, 0xc7, 0x11, 0x69, 0xf6, 0xda, 0x77,
    0xec, 0x91, 0xff, 0x1d, 0x2f, 0x64, 0x9e, 0xd1,
};
static const size_t TEST_DVPT128_49_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_49_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_49_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_56_NONCE[] = {
    0xd0, 0xa1, 0x50, 0x8f, 0xde, 0xfc, 0xf5, 0xbe,
    0x30, 0xa4, 0x59, 0xb8, 0x13,
};
static const size_t TEST_DVPT128_56_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_56_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_56_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_56_EXPECTED[] = {
    0x1a, 0xe3, 0x42, 0x07, 0xe7, 0x4c, 0x8c, 0x78,
    0x89, 0x0a, 0xe1, 0x7e, 0x32, 0x0e, 0x84, 0xbd,
};
static const size_t TEST_DVPT128_56_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_56_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_56_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_57_NONCE[] = {
    0x53, 0x81, 0xa6, 0x1b, 0x44, 0x9d, 0xc6, 0xa4,
    0x2a, 0xa4, 0xc7, 0x9b, 0x95,
};
static const size_t TEST_DVPT128_57_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_57_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_57_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_57_EXPECTED[] = {
    0x5c, 0x5f, 0xa2, 0x54, 0xc0, 0xbe, 0x50, 0x3b,
    0x02, 0xca, 0xff, 0xad, 0xe6, 0xb8, 0x52, 0x59,
};
static const size_t TEST_DVPT128_57_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_57_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_57_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_58_NONCE[] = {
    0xc5, 0x54, 0x30, 0xf2, 0xda, 0x06, 0x87, 0xea,
    0x40, 0x31, 0x38, 0x84, 0xab,
};
static const size_t TEST_DVPT128_58_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_58_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_58_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_58_EXPECTED[] = {
    0x93, 0x40, 0x26, 0x67, 0x30, 0xea, 0x36, 0x20,
    0x7b, 0xb7, 0x34, 0x81, 0x9d, 0x35, 0x53, 0xe9,
};
static const size_t TEST_DVPT128_58_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_58_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_58_INPUT_LEN = 0;

/* Alen = 0, Plen = 24, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_4_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_4_KEY[] = {
    0x19, 0xeb, 0xfd, 0xe2, 0xd5, 0x46, 0x8b, 0xa0,
    0xa3, 0x03, 0x1b, 0xde, 0x62, 0x9b, 0x11, 0xfd,
};
static const size_t TEST_DVPT128_GROUP_4_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_60_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_60_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_60_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_60_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_60_EXPECTED[] = {
    0xa9, 0x0e, 0x8e, 0xa4, 0x40, 0x85, 0xce, 0xd7,
    0x91, 0xb2, 0xfd, 0xb7, 0xfd, 0x44, 0xb5, 0xcf,
    0x0b, 0xd7, 0xd2, 0x77, 0x18, 0x02, 0x9b, 0xb7,
    0x03, 0xe1, 0xfa, 0x6b,
};
static const size_t TEST_DVPT128_60_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_60_INPUT[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
};
static const size_t TEST_DVPT128_60_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_64_NONCE[] = {
    0x12, 0x3a, 0x0b, 0xea, 0xce, 0x4e, 0x39,
};
static const size_t TEST_DVPT128_64_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_64_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_64_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_64_EXPECTED[] = {
    0x47, 0xd7, 0x14, 0x09, 0xa0, 0x3c, 0x33, 0x0b,
    0xe9, 0x45, 0x1b, 0x3f, 0x92, 0xc9, 0xd2, 0x1c,
    0x58, 0x43, 0x91, 0xad, 0x10, 0x10, 0xe9, 0xd6,
    0x09, 0xb8, 0x98, 0x01,
};
static const size_t TEST_DVPT128_64_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_64_INPUT[] = {
    0x9d, 0x03, 0x3e, 0x3b, 0x66, 0xef, 0xed, 0x14,
    0x67, 0x86, 0x8f, 0x38, 0x24, 0x17, 0xc8, 0x05,
    0x94, 0x87, 0x7a, 0x28, 0xbc, 0x97, 0xf4, 0x06,
};
static const size_t TEST_DVPT128_64_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_71_NONCE[] = {
    0xf6, 0x7b, 0x98, 0xef, 0xd3, 0x9b, 0x55,
};
static const size_t TEST_DVPT128_71_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_71_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_71_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_71_EXPECTED[] = {
    0xdd, 0x17, 0x59, 0x05, 0xa7, 0xea, 0x3a, 0xef,
    0x9f, 0xce, 0x06, 0x8e, 0x6c, 0xb7, 0x8e, 0x9c,
    0xc6, 0x05, 0x19, 0x75, 0x5a, 0x17, 0x8c, 0x77,
    0xb7, 0x53, 0x18, 0x1c,
};
static const size_t TEST_DVPT128_71_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_71_INPUT[] = {
    0xf2, 0xe9, 0x44, 0xe1, 0xae, 0x47, 0xad, 0x58,
    0x73, 0xbf, 0x39, 0x1f, 0x1b, 0x0c, 0xc0, 0x7f,
    0x61, 0x51, 0xeb, 0x4c, 0x50, 0xbb, 0x45, 0xb2,
};
static const size_t TEST_DVPT128_71_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_72_NONCE[] = {
    0xe6, 0x0e, 0x2c, 0x00, 0x2d, 0x1c, 0x99,
};
static const size_t TEST_DVPT128_72_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_72_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_72_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_72_EXPECTED[] = {
    0x8a, 0xd6, 0xb7, 0x6f, 0x54, 0x39, 0x2e, 0xe0,
    0xf2, 0x83, 0x4f, 0x09, 0x14, 0x25, 0x45, 0xbc,
    0xde, 0x9b, 0xf0, 0x3d, 0x04, 0xd6, 0x4a, 0xa1,
    0x08, 0x76, 0xf2, 0xda,
};
static const size_t TEST_DVPT128_72_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_72_INPUT[] = {
    0x70, 0xf4, 0x8d, 0xc1, 0xd7, 0x6e, 0x50, 0x28,
    0xda, 0x07, 0xe2, 0x98, 0x52, 0x80, 0x13, 0x75,
    0xa9, 0xed, 0xb2, 0x21, 0x4a, 0x5e, 0xa4, 0xc0,
};
static const size_t TEST_DVPT128_72_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_73_NONCE[] = {
    0x09, 0x8e, 0x05, 0x3f, 0xa0, 0x80, 0x43,
};
static const size_t TEST_DVPT128_73_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_73_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_73_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_73_EXPECTED[] = {
    0x80, 0x8e, 0xb3, 0xe0, 0x4c, 0x39, 0xab, 0xde,
    0x64, 0x67, 0x4f, 0x0f, 0x77, 0x16, 0xdd, 0xe1,
    0x16, 0x99, 0xcf, 0xf8, 0xdd, 0x36, 0x7c, 0x4c,
    0xd4, 0xf7, 0xfc, 0x07,
};
static const size_t TEST_DVPT128_73_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_73_INPUT[] = {
    0xbd, 0x81, 0x68, 0x0e, 0x3d, 0xc0, 0xb3, 0x54,
    0x31, 0xc9, 0x25, 0x98, 0xdc, 0xaa, 0x26, 0xef,
    0x09, 0xca, 0x0d, 0xa5, 0xe7, 0x71, 0x93, 0xde,
};
static const size_t TEST_DVPT128_73_INPUT_LEN = 24;

/* Alen = 0, Plen = 24, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_5_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_5_KEY[] = {
    0x19, 0x7a, 0xfb, 0x02, 0xff, 0xbd, 0x8f, 0x69,
    0x9d, 0xac, 0xae, 0x87, 0x09, 0x4d, 0x52, 0x43,
};
static const size_t TEST_DVPT128_GROUP_5_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_75_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_75_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_75_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_75_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_75_EXPECTED[] = {
    0x24, 0xab, 0x9e, 0xeb, 0x0e, 0x55, 0x08, 0xca,
    0xe8, 0x00, 0x74, 0xf1, 0x07, 0x0e, 0xe1, 0x88,
    0xa6, 0x37, 0x17, 0x18, 0x60, 0x88, 0x1f, 0x1f,
    0x2d, 0x9a, 0x3f, 0xbc, 0x21, 0x05, 0x95, 0xb7,
    0xb8, 0xb1, 0xb4, 0x15, 0x23, 0x11, 0x1a, 0x8e,
};
static const size_t TEST_DVPT128_75_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_75_INPUT[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
};
static const size_t TEST_DVPT128_75_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_79_NONCE[] = {
    0x12, 0x3a, 0x0b, 0xea, 0xce, 0x4e, 0x39,
};
static const size_t TEST_DVPT128_79_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_79_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_79_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_79_EXPECTED[] = {
    0xd4, 0x30, 0x35, 0xcd, 0xb5, 0xa1, 0x86, 0x8a,
    0xa4, 0x30, 0xe8, 0xb4, 0x1a, 0x1d, 0xc5, 0x7a,
    0x63, 0x90, 0x87, 0x23, 0x8e, 0x38, 0xbd, 0x62,
    0x8f, 0xee, 0xda, 0x2e, 0x8f, 0x24, 0x9d, 0xd9,
    0x3a, 0x83, 0x58, 0xde, 0xf7, 0x63, 0x98, 0x75,
};
static const size_t TEST_DVPT128_79_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_79_INPUT[] = {
    0x9d, 0x03, 0x3e, 0x3b, 0x66, 0xef, 0xed, 0x14,
    0x67, 0x86, 0x8f, 0x38, 0x24, 0x17, 0xc8, 0x05,
    0x94, 0x87, 0x7a, 0x28, 0xbc, 0x97, 0xf4, 0x06,
};
static const size_t TEST_DVPT128_79_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_86_NONCE[] = {
    0xf6, 0x7b, 0x98, 0xef, 0xd3, 0x9b, 0x55,
};
static const size_t TEST_DVPT128_86_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_86_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_86_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_86_EXPECTED[] = {
    0x37, 0xd6, 0x3c, 0x2b, 0xbf, 0x44, 0xd2, 0xeb,
    0x15, 0x5e, 0xcc, 0x1a, 0x84, 0x48, 0x41, 0xd5,
    0xc3, 0x3f, 0x1a, 0x6d, 0x44, 0x34, 0x19, 0x33,
    0x02, 0x17, 0xa4, 0xf1, 0xf4, 0xfb, 0x30, 0x22,
    0x57, 0xb0, 0xde, 0x7c, 0x9d, 0xa2, 0xe7, 0x50,
};
static const size_t TEST_DVPT128_86_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_86_INPUT[] = {
    0xf2, 0xe9, 0x44, 0xe1, 0xae, 0x47, 0xad, 0x58,
    0x73, 0xbf, 0x39, 0x1f, 0x1b, 0x0c, 0xc0, 0x7f,
    0x61, 0x51, 0xeb, 0x4c, 0x50, 0xbb, 0x45, 0xb2,
};
static const size_t TEST_DVPT128_86_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_87_NONCE[] = {
    0xe6, 0x0e, 0x2c, 0x00, 0x2d, 0x1c, 0x99,
};
static const size_t TEST_DVPT128_87_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_87_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_87_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_87_EXPECTED[] = {
    0x33, 0xe0, 0xdc, 0xe4, 0x41, 0x0e, 0x51, 0xbe,
    0xd5, 0x32, 0x3e, 0xa4, 0x94, 0x90, 0x20, 0x70,
    0x84, 0xac, 0x91, 0x73, 0x2b, 0xae, 0x42, 0x92,
    0x36, 0xa3, 0x05, 0xd5, 0x20, 0xa1, 0xa2, 0x49,
    0x30, 0xa7, 0x0a, 0x31, 0x1a, 0xa3, 0x69, 0x5d,
};
static const size_t TEST_DVPT128_87_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_87_INPUT[] = {
    0x70, 0xf4, 0x8d, 0xc1, 0xd7, 0x6e, 0x50, 0x28,
    0xda, 0x07, 0xe2, 0x98, 0x52, 0x80, 0x13, 0x75,
    0xa9, 0xed, 0xb2, 0x21, 0x4a, 0x5e, 0xa4, 0xc0,
};
static const size_t TEST_DVPT128_87_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_88_NONCE[] = {
    0x09, 0x8e, 0x05, 0x3f, 0xa0, 0x80, 0x43,
};
static const size_t TEST_DVPT128_88_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_88_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_88_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_88_EXPECTED[] = {
    0x1d, 0x73, 0x2c, 0x33, 0x43, 0x19, 0xbd, 0x77,
    0x5e, 0x7c, 0xf9, 0x3d, 0xbd, 0xc4, 0x20, 0x4b,
    0xbd, 0xb5, 0x81, 0x92, 0xbe, 0x08, 0x28, 0x04,
    0x81, 0xe3, 0xd6, 0x4e, 0xd5, 0x46, 0xb6, 0xb7,
    0x0e, 0xe0, 0x88, 0xa6, 0x93, 0xf5, 0x5f, 0xbb,
};
static const size_t TEST_DVPT128_88_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_88_INPUT[] = {
    0xbd, 0x81, 0x68, 0x0e, 0x3d, 0xc0, 0xb3, 0x54,
    0x31, 0xc9, 0x25, 0x98, 0xdc, 0xaa, 0x26, 0xef,
    0x09, 0xca, 0x0d, 0xa5, 0xe7, 0x71, 0x93, 0xde,
};
static const size_t TEST_DVPT128_88_INPUT_LEN = 24;

/* Alen = 0, Plen = 24, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_6_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_6_KEY[] = {
    0x19, 0x7a, 0xfb, 0x02, 0xff, 0xbd, 0x8f, 0x69,
    0x9d, 0xac, 0xae, 0x87, 0x09, 0x4d, 0x52, 0x43,
};
static const size_t TEST_DVPT128_GROUP_6_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_90_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_90_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_90_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_90_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_90_EXPECTED[] = {
    0x4a, 0x55, 0x01, 0x34, 0xf9, 0x44, 0x55, 0x97,
    0x9e, 0xc4, 0xbf, 0x89, 0xad, 0x2b, 0xd8, 0x0d,
    0x25, 0xa7, 0x7a, 0xe9, 0x4e, 0x45, 0x61, 0x34,
    0xa3, 0xe1, 0x38, 0xb9,
};
static const size_t TEST_DVPT128_90_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_90_INPUT[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
};
static const size_t TEST_DVPT128_90_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_94_NONCE[] = {
    0x24, 0xb7, 0xa6, 0x53, 0x91, 0xf8, 0x8b, 0xea,
    0x38, 0xfc, 0xd5, 0x4a, 0x9a,
};
static const size_t TEST_DVPT128_94_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_94_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_94_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_94_EXPECTED[] = {
    0x05, 0xf2, 0x0b, 0x2a, 0xe7, 0x0f, 0xcb, 0x0e,
    0xa7, 0x9a, 0xa1, 0x84, 0x5c, 0x15, 0xb8, 0x99,
    0xa7, 0x99, 0xca, 0x60, 0xf5, 0x1e, 0x6c, 0x29,
    0x64, 0x13, 0x02, 0x0a,
};
static const size_t TEST_DVPT128_94_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_94_INPUT[] = {
    0x43, 0x41, 0x97, 0x15, 0xce, 0xf9, 0xa4, 0x8d,
    0xc7, 0x28, 0x0b, 0xc0, 0x35, 0x08, 0x2a, 0x65,
    0x81, 0xaf, 0xd1, 0xd8, 0x2b, 0xee, 0x9d, 0x1a,
};
static const size_t TEST_DVPT128_94_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_101_NONCE[] = {
    0xc4, 0x7a, 0xf8, 0x0c, 0xd2, 0x6d, 0x04, 0x76,
    0x30, 0xc1, 0xfd, 0xf0, 0xd1,
};
static const size_t TEST_DVPT128_101_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_101_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_101_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_101_EXPECTED[] = {
    0xa2, 0xa5, 0x90, 0x41, 0xc3, 0xf7, 0x8f, 0x6e,
    0x10, 0xc3, 0x04, 0x51, 0x18, 0xe8, 0xa4, 0x75,
    0x94, 0x5e, 0x24, 0xc8, 0x5b, 0x02, 0xab, 0xc4,
    0x0f, 0x8f, 0xb9, 0x49,
};
static const size_t TEST_DVPT128_101_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_101_INPUT[] = {
    0xd8, 0x30, 0x6c, 0x9c, 0x4e, 0xa6, 0xc6, 0x9c,
    0x6e, 0x2a, 0xd0, 0xfc, 0x0e, 0x49, 0xb1, 0xe0,
    0x12, 0x6b, 0x01, 0x07, 0x8d, 0x64, 0x19, 0xff,
};
static const size_t TEST_DVPT128_101_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_102_NONCE[] = {
    0x70, 0xe1, 0x32, 0x02, 0x3a, 0xca, 0xe1, 0xf8,
    0x8c, 0x7a, 0x23, 0x7b, 0x68,
};
static const size_t TEST_DVPT128_102_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_102_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_102_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_102_EXPECTED[] = {
    0x19, 0xb4, 0xad, 0x22, 0x27, 0x95, 0x32, 0x6c,
    0xb0, 0x31, 0xcf, 0xdb, 0x07, 0xb6, 0x52, 0xdb,
    0xf6, 0x4c, 0xa5, 0xdb, 0x5f, 0xf5, 0xd6, 0xd5,
    0x69, 0xd8, 0xab, 0x41,
};
static const size_t TEST_DVPT128_102_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_102_INPUT[] = {
    0xd0, 0xb2, 0xbe, 0xf5, 0xed, 0x1a, 0x87, 0xd9,
    0xc7, 0x3d, 0x4a, 0x45, 0x9c, 0xb0, 0x5c, 0x11,
    0x79, 0x9c, 0x4f, 0x51, 0xad, 0x64, 0x0b, 0x1e,
};
static const size_t TEST_DVPT128_102_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_103_NONCE[] = {
    0x80, 0x10, 0xd3, 0xa2, 0xa1, 0x4f, 0x72, 0xf5,
    0x58, 0x5d, 0xef, 0xc9, 0x40,
};
static const size_t TEST_DVPT128_103_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_103_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_103_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_103_EXPECTED[] = {
    0x76, 0xb6, 0x6b, 0x90, 0x86, 0x57, 0xf4, 0xdf,
    0x8a, 0x32, 0x9c, 0x34, 0xcc, 0xdd, 0xe5, 0x0a,
    0xe7, 0xfc, 0x71, 0xc4, 0xa7, 0x18, 0xb7, 0x12,
    0xf0, 0x0f, 0xe7, 0x64,
};
static const size_t TEST_DVPT128_103_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_103_INPUT[] = {
    0x4f, 0xab, 0xa0, 0x55, 0x69, 0xbf, 0x7a, 0xc6,
    0x56, 0x78, 0x0c, 0x16, 0x99, 0x5e, 0x91, 0x22,
    0xe5, 0x65, 0xfe, 0x99, 0x84, 0xbe, 0x8a, 0x68,
};
static const size_t TEST_DVPT128_103_INPUT_LEN = 24;

/* Alen = 0, Plen = 24, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_7_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_7_KEY[] = {
    0x90, 0x92, 0x9a, 0x4b, 0x0a, 0xc6, 0x5b, 0x35,
    0x0a, 0xd1, 0x59, 0x16, 0x11, 0xfe, 0x48, 0x29,
};
static const size_t TEST_DVPT128_GROUP_7_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_105_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_105_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_105_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_105_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_105_EXPECTED[] = {
    0x4b, 0xfe, 0x4e, 0x35, 0x78, 0x4f, 0x0a, 0x65,
    0xb5, 0x45, 0x47, 0x7e, 0x5e, 0x2f, 0x4b, 0xae,
    0x0e, 0x1e, 0x6f, 0xa7, 0x17, 0xea, 0xf2, 0xcb,
    0x6a, 0x9a, 0x97, 0x0b, 0x9b, 0xeb, 0x2a, 0xc1,
    0xbd, 0x4f, 0xd6, 0x21, 0x68, 0xf8, 0x37, 0x8a,
};
static const size_t TEST_DVPT128_105_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_105_INPUT[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
};
static const size_t TEST_DVPT128_105_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_109_NONCE[] = {
    0x24, 0xb7, 0xa6, 0x53, 0x91, 0xf8, 0x8b, 0xea,
    0x38, 0xfc, 0xd5, 0x4a, 0x9a,
};
static const size_t TEST_DVPT128_109_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_109_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_109_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_109_EXPECTED[] = {
    0x9f, 0xa8, 0x46, 0xef, 0x8d, 0x19, 0x8c, 0x53,
    0x8f, 0x84, 0xf8, 0x56, 0xba, 0xb8, 0xf7, 0xf9,
    0xc3, 0xbe, 0xd9, 0x0b, 0x53, 0xac, 0xb6, 0xa3,
    0x26, 0x58, 0xe0, 0x77, 0x68, 0x73, 0x15, 0xea,
    0xf1, 0x14, 0x58, 0xbd, 0xf6, 0xe3, 0xc3, 0x6a,
};
static const size_t TEST_DVPT128_109_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_109_INPUT[] = {
    0x43, 0x41, 0x97, 0x15, 0xce, 0xf9, 0xa4, 0x8d,
    0xc7, 0x28, 0x0b, 0xc0, 0x35, 0x08, 0x2a, 0x65,
    0x81, 0xaf, 0xd1, 0xd8, 0x2b, 0xee, 0x9d, 0x1a,
};
static const size_t TEST_DVPT128_109_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_116_NONCE[] = {
    0xc4, 0x7a, 0xf8, 0x0c, 0xd2, 0x6d, 0x04, 0x76,
    0x30, 0xc1, 0xfd, 0xf0, 0xd1,
};
static const size_t TEST_DVPT128_116_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_116_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_116_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_116_EXPECTED[] = {
    0x99, 0xe4, 0x0b, 0x3c, 0x67, 0xac, 0xa9, 0x5d,
    0xd4, 0x46, 0x2c, 0x20, 0xcb, 0xd6, 0xb2, 0x74,
    0x1e, 0x70, 0x33, 0xfc, 0x4f, 0x41, 0xa9, 0x75,
    0xc9, 0x39, 0x0f, 0xbd, 0xb9, 0xec, 0x41, 0x62,
    0x67, 0x09, 0x6c, 0xcb, 0xf2, 0xc1, 0x48, 0xe5,
};
static const size_t TEST_DVPT128_116_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_116_INPUT[] = {
    0xd8, 0x30, 0x6c, 0x9c, 0x4e, 0xa6, 0xc6, 0x9c,
    0x6e, 0x2a, 0xd0, 0xfc, 0x0e, 0x49, 0xb1, 0xe0,
    0x12, 0x6b, 0x01, 0x07, 0x8d, 0x64, 0x19, 0xff,
};
static const size_t TEST_DVPT128_116_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_117_NONCE[] = {
    0x70, 0xe1, 0x32, 0x02, 0x3a, 0xca, 0xe1, 0xf8,
    0x8c, 0x7a, 0x23, 0x7b, 0x68,
};
static const size_t TEST_DVPT128_117_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_117_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_117_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_117_EXPECTED[] = {
    0xde, 0x07, 0x94, 0x18, 0xc2, 0x5b, 0xa6, 0x7e,
    0x5f, 0xda, 0x00, 0x99, 0x98, 0xe3, 0xfc, 0xe6,
    0x1b, 0xfd, 0xc3, 0xb7, 0x78, 0x7c, 0xf0, 0x66,
    0x55, 0xc1, 0x8a, 0xe3, 0x8b, 0x7e, 0xe7, 0xf0,
    0x0f, 0x96, 0xcf, 0xca, 0x4f, 0xe9, 0xa2, 0xef,
};
static const size_t TEST_DVPT128_117_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_117_INPUT[] = {
    0xd0, 0xb2, 0xbe, 0xf5, 0xed, 0x1a, 0x87, 0xd9,
    0xc7, 0x3d, 0x4a, 0x45, 0x9c, 0xb0, 0x5c, 0x11,
    0x79, 0x9c, 0x4f, 0x51, 0xad, 0x64, 0x0b, 0x1e,
};
static const size_t TEST_DVPT128_117_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_118_NONCE[] = {
    0x80, 0x10, 0xd3, 0xa2, 0xa1, 0x4f, 0x72, 0xf5,
    0x58, 0x5d, 0xef, 0xc9, 0x40,
};
static const size_t TEST_DVPT128_118_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_118_ADATA[] = {
    0x00,
};
static const size_t TEST_DVPT128_118_ADATA_LEN = 0;

static const uint8_t TEST_DVPT128_118_EXPECTED[] = {
    0xfb, 0xab, 0x64, 0xd8, 0xdd, 0x8b, 0x6e, 0x33,
    0xc7, 0xcc, 0x61, 0x24, 0xcd, 0x65, 0xf0, 0x04,
    0xd7, 0x24, 0x72, 0x77, 0xfe, 0x98, 0xd5, 0xd3,
    0xb3, 0x53, 0x57, 0xa3, 0x5f, 0xf9, 0xe5, 0x8e,
    0x18, 0xd6, 0xd8, 0x0d, 0xf9, 0xfc, 0x33, 0x5d,
};
static const size_t TEST_DVPT128_118_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_118_INPUT[] = {
    0x4f, 0xab, 0xa0, 0x55, 0x69, 0xbf, 0x7a, 0xc6,
    0x56, 0x78, 0x0c, 0x16, 0x99, 0x5e, 0x91, 0x22,
    0xe5, 0x65, 0xfe, 0x99, 0x84, 0xbe, 0x8a, 0x68,
};
static const size_t TEST_DVPT128_118_INPUT_LEN = 24;

/* Alen = 32, Plen = 0, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_8_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_8_KEY[] = {
    0x90, 0x92, 0x9a, 0x4b, 0x0a, 0xc6, 0x5b, 0x35,
    0x0a, 0xd1, 0x59, 0x16, 0x11, 0xfe, 0x48, 0x29,
};
static const size_t TEST_DVPT128_GROUP_8_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_120_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_120_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_120_ADATA[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
    0xec, 0x22, 0xb1, 0xa2, 0x68, 0xf8, 0x8e, 0x2c,
};
static const size_t TEST_DVPT128_120_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_120_EXPECTED[] = {
    0x78, 0x2e, 0x43, 0x18,
};
static const size_t TEST_DVPT128_120_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_120_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_120_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_124_NONCE[] = {
    0x8c, 0x68, 0x7b, 0x43, 0x18, 0x81, 0x3a,
};
static const size_t TEST_DVPT128_124_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_124_ADATA[] = {
    0xfc, 0xad, 0x52, 0xa8, 0x85, 0x44, 0x32, 0x5b,
    0xb3, 0x1e, 0xb5, 0xde, 0x4a, 0x41, 0xdb, 0xff,
    0x6a, 0x96, 0xf6, 0x9d, 0x09, 0x93, 0xb9, 0x69,
    0xa0, 0x17, 0x92, 0xee, 0x23, 0x95, 0x3a, 0xcf,
};
static const size_t TEST_DVPT128_124_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_124_EXPECTED[] = {
    0x1b, 0xe5, 0x35, 0xa0,
};
static const size_t TEST_DVPT128_124_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_124_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_124_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_131_NONCE[] = {
    0xa1, 0xae, 0xda, 0x4b, 0x4c, 0xb8, 0xdd,
};
static const size_t TEST_DVPT128_131_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_131_ADATA[] = {
    0xdb, 0x30, 0x22, 0xef, 0x4c, 0xd6, 0x8a, 0xe2,
    0x2b, 0x50, 0x15, 0x99, 0x44, 0x8f, 0xfe, 0x2d,
    0xda, 0x15, 0xcf, 0xd2, 0xe2, 0x59, 0x31, 0x5c,
    0x6f, 0x6d, 0x03, 0x03, 0x6e, 0xde, 0xa9, 0x63,
};
static const size_t TEST_DVPT128_131_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_131_EXPECTED[] = {
    0xe6, 0x17, 0xe0, 0x06,
};
static const size_t TEST_DVPT128_131_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_131_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_131_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_132_NONCE[] = {
    0xf2, 0x48, 0xe5, 0x22, 0x5e, 0x3d, 0x9a,
};
static const size_t TEST_DVPT128_132_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_132_ADATA[] = {
    0xfd, 0xc6, 0x4e, 0xf7, 0x6a, 0x3b, 0xfd, 0x0a,
    0x15, 0xd0, 0xbc, 0x8e, 0x8b, 0xac, 0xaf, 0x64,
    0x34, 0x67, 0x96, 0xa3, 0xe3, 0x5a, 0xfc, 0xf2,
    0xac, 0x1a, 0xb1, 0x36, 0xf6, 0x3f, 0x7b, 0x6e,
};
static const size_t TEST_DVPT128_132_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_132_EXPECTED[] = {
    0xb7, 0x90, 0x93, 0x95,
};
static const size_t TEST_DVPT128_132_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_132_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_132_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_133_NONCE[] = {
    0xe6, 0x82, 0x28, 0xf5, 0xc6, 0x5b, 0x73,
};
static const size_t TEST_DVPT128_133_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_133_ADATA[] = {
    0x61, 0x4e, 0xfd, 0xf8, 0x9c, 0xe2, 0xa9, 0xfc,
    0xbd, 0x38, 0xbd, 0xc0, 0xb4, 0xce, 0xce, 0x54,
    0xdf, 0xd7, 0x53, 0x28, 0x80, 0xe0, 0xb4, 0xce,
    0x6e, 0xb3, 0xa4, 0x01, 0x0b, 0x7c, 0xb1, 0xe7,
};
static const size_t TEST_DVPT128_133_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_133_EXPECTED[] = {
    0x8a, 0x05, 0xd2, 0xea,
};
static const size_t TEST_DVPT128_133_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_133_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_133_INPUT_LEN = 0;

/* Alen = 32, Plen = 0, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_9_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_9_KEY[] = {
    0x6a, 0x79, 0x8d, 0x7c, 0x5e, 0x1a, 0x72, 0xb4,
    0x3e, 0x20, 0xad, 0x5c, 0x7b, 0x08, 0x56, 0x7b,
};
static const size_t TEST_DVPT128_GROUP_9_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_135_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_135_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_135_ADATA[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
    0xec, 0x22, 0xb1, 0xa2, 0x68, 0xf8, 0x8e, 0x2c,
};
static const size_t TEST_DVPT128_135_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_135_EXPECTED[] = {
    0x41, 0xb4, 0x76, 0x01, 0x3f, 0x45, 0xe4, 0xa7,
    0x81, 0xf2, 0x53, 0xa6, 0xf3, 0xb1, 0xe5, 0x30,
};
static const size_t TEST_DVPT128_135_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_135_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_135_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_139_NONCE[] = {
    0x8c, 0x68, 0x7b, 0x43, 0x18, 0x81, 0x3a,
};
static const size_t TEST_DVPT128_139_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_139_ADATA[] = {
    0xfc, 0xad, 0x52, 0xa8, 0x85, 0x44, 0x32, 0x5b,
    0xb3, 0x1e, 0xb5, 0xde, 0x4a, 0x41, 0xdb, 0xff,
    0x6a, 0x96, 0xf6, 0x9d, 0x09, 0x93, 0xb9, 0x69,
    0xa0, 0x17, 0x92, 0xee, 0x23, 0x95, 0x3a, 0xcf,
};
static const size_t TEST_DVPT128_139_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_139_EXPECTED[] = {
    0xec, 0x77, 0x4d, 0x90, 0x00, 0x76, 0x3b, 0xba,
    0x3a, 0x5a, 0xc3, 0x07, 0x41, 0x88, 0x27, 0xb2,
};
static const size_t TEST_DVPT128_139_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_139_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_139_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_146_NONCE[] = {
    0xa1, 0xae, 0xda, 0x4b, 0x4c, 0xb8, 0xdd,
};
static const size_t TEST_DVPT128_146_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_146_ADATA[] = {
    0xdb, 0x30, 0x22, 0xef, 0x4c, 0xd6, 0x8a, 0xe2,
    0x2b, 0x50, 0x15, 0x99, 0x44, 0x8f, 0xfe, 0x2d,
    0xda, 0x15, 0xcf, 0xd2, 0xe2, 0x59, 0x31, 0x5c,
    0x6f, 0x6d, 0x03, 0x03, 0x6e, 0xde, 0xa9, 0x63,
};
static const size_t TEST_DVPT128_146_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_146_EXPECTED[] = {
    0x0b, 0x9d, 0x79, 0xe8, 0xe3, 0x3e, 0xc4, 0x55,
    0x32, 0xaf, 0x55, 0x15, 0xa9, 0x9f, 0x05, 0xdf,
};
static const size_t TEST_DVPT128_146_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_146_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_146_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_147_NONCE[] = {
    0xf2, 0x48, 0xe5, 0x22, 0x5e, 0x3d, 0x9a,
};
static const size_t TEST_DVPT128_147_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_147_ADATA[] = {
    0xfd, 0xc6, 0x4e, 0xf7, 0x6a, 0x3b, 0xfd, 0x0a,
    0x15, 0xd0, 0xbc, 0x8e, 0x8b, 0xac, 0xaf, 0x64,
    0x34, 0x67, 0x96, 0xa3, 0xe3, 0x5a, 0xfc, 0xf2,
    0xac, 0x1a, 0xb1, 0x36, 0xf6, 0x3f, 0x7b, 0x6e,
};
static const size_t TEST_DVPT128_147_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_147_EXPECTED[] = {
    0x15, 0x83, 0xe1, 0xe5, 0xa8, 0x60, 0x01, 0xbb,
    0xce, 0xc6, 0x22, 0x92, 0xcc, 0xfd, 0x4d, 0x48,
};
static const size_t TEST_DVPT128_147_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_147_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_147_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_148_NONCE[] = {
    0xe6, 0x82, 0x28, 0xf5, 0xc6, 0x5b, 0x73,
};
static const size_t TEST_DVPT128_148_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_148_ADATA[] = {
    0x61, 0x4e, 0xfd, 0xf8, 0x9c, 0xe2, 0xa9, 0xfc,
    0xbd, 0x38, 0xbd, 0xc0, 0xb4, 0xce, 0xce, 0x54,
    0xdf, 0xd7, 0x53, 0x28, 0x80, 0xe0, 0xb4, 0xce,
    0x6e, 0xb3, 0xa4, 0x01, 0x0b, 0x7c, 0xb1, 0xe7,
};
static const size_t TEST_DVPT128_148_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_148_EXPECTED[] = {
    0xb7, 0x2c, 0xaa, 0xc6, 0x36, 0x2e, 0x68, 0xe4,
    0x45, 0xf6, 0x9f, 0x60, 0x5f, 0x21, 0xe0, 0xa2,
};
static const size_t TEST_DVPT128_148_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_148_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_148_INPUT_LEN = 0;

/* Alen = 32, Plen = 0, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_10_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_10_KEY[] = {
    0x6a, 0x79, 0x8d, 0x7c, 0x5e, 0x1a, 0x72, 0xb4,
    0x3e, 0x20, 0xad, 0x5c, 0x7b, 0x08, 0x56, 0x7b,
};
static const size_t TEST_DVPT128_GROUP_10_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_150_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_150_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_150_ADATA[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
    0xa7, 0xee, 0x64, 0x10, 0x18, 0x4c, 0x79, 0x82,
};
static const size_t TEST_DVPT128_150_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_150_EXPECTED[] = {
    0x9f, 0x69, 0xf2, 0x4f,
};
static const size_t TEST_DVPT128_150_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_150_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_150_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_154_NONCE[] = {
    0x1e, 0x7e, 0x51, 0xf0, 0xfa, 0x9a, 0x33, 0xed,
    0x61, 0x8c, 0x26, 0xf5, 0xe3,
};
static const size_t TEST_DVPT128_154_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_154_ADATA[] = {
    0xda, 0x9b, 0x8f, 0xfb, 0x0f, 0x3c, 0x2a, 0xee,
    0x2e, 0x38, 0x6c, 0xc9, 0xf0, 0x35, 0xec, 0x1e,
    0xb3, 0xe6, 0x29, 0xbd, 0x15, 0x44, 0xc1, 0x1d,
    0xc2, 0x1b, 0xe4, 0xfd, 0x8a, 0xc9, 0x07, 0x4a,
};
static const size_t TEST_DVPT128_154_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_154_EXPECTED[] = {
    0xc2, 0x83, 0x46, 0x6f,
};
static const size_t TEST_DVPT128_154_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_154_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_154_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_161_NONCE[] = {
    0x78, 0x64, 0xc7, 0x17, 0xec, 0x93, 0xdb, 0x38,
    0xb1, 0x06, 0x79, 0xbe, 0x47,
};
static const size_t TEST_DVPT128_161_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_161_ADATA[] = {
    0x67, 0x9a, 0xad, 0x1a, 0xd1, 0xe5, 0x70, 0x29,
    0xe3, 0x36, 0x2b, 0x32, 0x55, 0x72, 0xfc, 0x71,
    0xca, 0xc5, 0x31, 0x84, 0xb0, 0xf1, 0x54, 0x68,
    0x67, 0xe6, 0x65, 0xa4, 0xa5, 0x94, 0x66, 0xc4,
};
static const size_t TEST_DVPT128_161_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_161_EXPECTED[] = {
    0x48, 0xf3, 0xa1, 0xec,
};
static const size_t TEST_DVPT128_161_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_161_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_161_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_162_NONCE[] = {
    0xc3, 0xbf, 0x9d, 0xfe, 0x9d, 0x6c, 0x26, 0xf5,
    0x43, 0x18, 0x8f, 0xb4, 0x57,
};
static const size_t TEST_DVPT128_162_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_162_ADATA[] = {
    0xe3, 0x01, 0xf6, 0x9a, 0xd3, 0xa7, 0xe0, 0x8a,
    0x3d, 0x02, 0x46, 0x2f, 0x0a, 0xa5, 0x84, 0x44,
    0x9e, 0xb0, 0x44, 0x9b, 0x0e, 0x3c, 0x50, 0xaa,
    0x8d, 0xfa, 0xa4, 0x47, 0x28, 0x16, 0xc8, 0xb0,
};
static const size_t TEST_DVPT128_162_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_162_EXPECTED[] = {
    0x24, 0x76, 0x3d, 0xef,
};
static const size_t TEST_DVPT128_162_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_162_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_162_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_163_NONCE[] = {
    0x15, 0x27, 0x65, 0x7d, 0x2f, 0xd9, 0x8f, 0x7d,
    0xec, 0xa5, 0x5c, 0xc6, 0x49,
};
static const size_t TEST_DVPT128_163_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_163_ADATA[] = {
    0xf4, 0xc7, 0x23, 0x43, 0x3b, 0x7c, 0xaf, 0xe3,
    0xcd, 0xa9, 0xbb, 0x49, 0x40, 0xa2, 0x1a, 0x89,
    0xa8, 0x38, 0x2d, 0x13, 0x01, 0x8b, 0x62, 0x2c,
    0xcd, 0x1f, 0xfb, 0x9f, 0xfd, 0x32, 0x11, 0xaf,
};
static const size_t TEST_DVPT128_163_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_163_EXPECTED[] = {
    0x63, 0x39, 0x4b, 0xee,
};
static const size_t TEST_DVPT128_163_EXPECTED_LEN = 4;

static const uint8_t TEST_DVPT128_163_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_163_INPUT_LEN = 0;

/* Alen = 32, Plen = 0, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_11_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_11_KEY[] = {
    0xf9, 0xfd, 0xca, 0x4a, 0xc6, 0x4f, 0xe7, 0xf0,
    0x14, 0xde, 0x0f, 0x43, 0x03, 0x9c, 0x75, 0x71,
};
static const size_t TEST_DVPT128_GROUP_11_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_165_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_165_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_165_ADATA[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
    0xa7, 0xee, 0x64, 0x10, 0x18, 0x4c, 0x79, 0x82,
};
static const size_t TEST_DVPT128_165_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_165_EXPECTED[] = {
    0x18, 0x59, 0xac, 0x36, 0xa4, 0x0a, 0x6b, 0x28,
    0xb3, 0x42, 0x66, 0x25, 0x36, 0x27, 0x79, 0x7a,
};
static const size_t TEST_DVPT128_165_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_165_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_165_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_169_NONCE[] = {
    0x1e, 0x7e, 0x51, 0xf0, 0xfa, 0x9a, 0x33, 0xed,
    0x61, 0x8c, 0x26, 0xf5, 0xe3,
};
static const size_t TEST_DVPT128_169_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_169_ADATA[] = {
    0xda, 0x9b, 0x8f, 0xfb, 0x0f, 0x3c, 0x2a, 0xee,
    0x2e, 0x38, 0x6c, 0xc9, 0xf0, 0x35, 0xec, 0x1e,
    0xb3, 0xe6, 0x29, 0xbd, 0x15, 0x44, 0xc1, 0x1d,
    0xc2, 0x1b, 0xe4, 0xfd, 0x8a, 0xc9, 0x07, 0x4a,
};
static const size_t TEST_DVPT128_169_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_169_EXPECTED[] = {
    0x8b, 0x5b, 0xfe, 0x6b, 0x5b, 0x55, 0x52, 0x00,
    0x73, 0x00, 0xba, 0xe7, 0x11, 0x72, 0x61, 0x2f,
};
static const size_t TEST_DVPT128_169_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_169_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_169_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_176_NONCE[] = {
    0x78, 0x64, 0xc7, 0x17, 0xec, 0x93, 0xdb, 0x38,
    0xb1, 0x06, 0x79, 0xbe, 0x47,
};
static const size_t TEST_DVPT128_176_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_176_ADATA[] = {
    0x67, 0x9a, 0xad, 0x1a, 0xd1, 0xe5, 0x70, 0x29,
    0xe3, 0x36, 0x2b, 0x32, 0x55, 0x72, 0xfc, 0x71,
    0xca, 0xc5, 0x31, 0x84, 0xb0, 0xf1, 0x54, 0x68,
    0x67, 0xe6, 0x65, 0xa4, 0xa5, 0x94, 0x66, 0xc4,
};
static const size_t TEST_DVPT128_176_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_176_EXPECTED[] = {
    0xe9, 0xcf, 0xb1, 0x06, 0x93, 0x80, 0x43, 0x4f,
    0x22, 0x1d, 0xb4, 0x22, 0x9a, 0x08, 0x3a, 0x76,
};
static const size_t TEST_DVPT128_176_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_176_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_176_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_177_NONCE[] = {
    0xc3, 0xbf, 0x9d, 0xfe, 0x9d, 0x6c, 0x26, 0xf5,
    0x43, 0x18, 0x8f, 0xb4, 0x57,
};
static const size_t TEST_DVPT128_177_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_177_ADATA[] = {
    0xe3, 0x01, 0xf6, 0x9a, 0xd3, 0xa7, 0xe0, 0x8a,
    0x3d, 0x02, 0x46, 0x2f, 0x0a, 0xa5, 0x84, 0x44,
    0x9e, 0xb0, 0x44, 0x9b, 0x0e, 0x3c, 0x50, 0xaa,
    0x8d, 0xfa, 0xa4, 0x47, 0x28, 0x16, 0xc8, 0xb0,
};
static const size_t TEST_DVPT128_177_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_177_EXPECTED[] = {
    0x38, 0x0c, 0xb5, 0x7f, 0xd5, 0x31, 0xbb, 0x1d,
    0xcf, 0x22, 0x35, 0x05, 0x18, 0xbb, 0xf8, 0xaf,
};
static const size_t TEST_DVPT128_177_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_177_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_177_INPUT_LEN = 0;

static const uint8_t TEST_DVPT128_178_NONCE[] = {
    0x15, 0x27, 0x65, 0x7d, 0x2f, 0xd9, 0x8f, 0x7d,
    0xec, 0xa5, 0x5c, 0xc6, 0x49,
};
static const size_t TEST_DVPT128_178_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_178_ADATA[] = {
    0xf4, 0xc7, 0x23, 0x43, 0x3b, 0x7c, 0xaf, 0xe3,
    0xcd, 0xa9, 0xbb, 0x49, 0x40, 0xa2, 0x1a, 0x89,
    0xa8, 0x38, 0x2d, 0x13, 0x01, 0x8b, 0x62, 0x2c,
    0xcd, 0x1f, 0xfb, 0x9f, 0xfd, 0x32, 0x11, 0xaf,
};
static const size_t TEST_DVPT128_178_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_178_EXPECTED[] = {
    0xfb, 0xf2, 0xbe, 0xcc, 0x35, 0xb5, 0x02, 0x40,
    0x78, 0xbf, 0xcf, 0xc1, 0xf8, 0x31, 0xb6, 0x69,
};
static const size_t TEST_DVPT128_178_EXPECTED_LEN = 16;

static const uint8_t TEST_DVPT128_178_INPUT[] = {
    0x00,
};
static const size_t TEST_DVPT128_178_INPUT_LEN = 0;

/* Alen = 32, Plen = 24, Nlen = 7, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_12_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_12_KEY[] = {
    0xf9, 0xfd, 0xca, 0x4a, 0xc6, 0x4f, 0xe7, 0xf0,
    0x14, 0xde, 0x0f, 0x43, 0x03, 0x9c, 0x75, 0x71,
};
static const size_t TEST_DVPT128_GROUP_12_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_180_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_180_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_180_ADATA[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
    0xec, 0x22, 0xb1, 0xa2, 0x68, 0xf8, 0x8e, 0x2c,
};
static const size_t TEST_DVPT128_180_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_180_EXPECTED[] = {
    0x6b, 0xe3, 0x18, 0x60, 0xca, 0x27, 0x1e, 0xf4,
    0x48, 0xde, 0x8f, 0x8d, 0x8b, 0x39, 0x34, 0x6d,
    0xaf, 0x4b, 0x81, 0xd7, 0xe9, 0x2d, 0x65, 0xb3,
    0x38, 0xf1, 0x25, 0xfa,
};
static const size_t TEST_DVPT128_180_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_180_INPUT[] = {
    0xa2, 0x65, 0x48, 0x0c, 0xa8, 0x8d, 0x5f, 0x53,
    0x6d, 0xb0, 0xdc, 0x6a, 0xbc, 0x40, 0xfa, 0xf0,
    0xd0, 0x5b, 0xe7, 0xa9, 0x66, 0x97, 0x77, 0x68,
};
static const size_t TEST_DVPT128_180_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_184_NONCE[] = {
    0xcc, 0xee, 0x19, 0xd0, 0x37, 0xcf, 0x4a,
};
static const size_t TEST_DVPT128_184_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_184_ADATA[] = {
    0xc0, 0x26, 0x69, 0x6e, 0x64, 0x25, 0xe6, 0xc3,
    0x3f, 0x45, 0xb4, 0x14, 0x5f, 0xeb, 0xf1, 0x13,
    0x7e, 0x7a, 0xc2, 0x63, 0x83, 0xc9, 0xf5, 0xaa,
    0x4c, 0xd4, 0xe5, 0xe8, 0xab, 0xb1, 0x9e, 0x07,
};
static const size_t TEST_DVPT128_184_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_184_EXPECTED[] = {
    0x9b, 0x61, 0x33, 0x5f, 0x96, 0xfc, 0x5b, 0x31,
    0x27, 0x4c, 0xc1, 0xfb, 0x27, 0x5f, 0x29, 0xc1,
    0x10, 0x5d, 0x68, 0xc6, 0x7b, 0x70, 0x65, 0x4f,
    0x94, 0x05, 0xed, 0xb1,
};
static const size_t TEST_DVPT128_184_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_184_INPUT[] = {
    0x0d, 0xf2, 0x02, 0x43, 0x1e, 0xe7, 0xf2, 0x51,
    0xa3, 0x8a, 0xaf, 0x6a, 0xa8, 0xcd, 0x31, 0x37,
    0x82, 0xbd, 0x29, 0x3a, 0xf9, 0x11, 0x40, 0x05,
};
static const size_t TEST_DVPT128_184_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_191_NONCE[] = {
    0xa8, 0x40, 0xe9, 0x8d, 0xf7, 0x2a, 0xe9,
};
static const size_t TEST_DVPT128_191_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_191_ADATA[] = {
    0x22, 0xc6, 0x60, 0x77, 0x32, 0xef, 0x1b, 0xdc,
    0x7f, 0xcf, 0x61, 0x97, 0xe0, 0x37, 0xcd, 0xad,
    0xd7, 0xee, 0x17, 0xc0, 0x08, 0x55, 0x2d, 0xd9,
    0xf0, 0x4b, 0x85, 0x64, 0xd3, 0x4f, 0xb1, 0x7c,
};
static const size_t TEST_DVPT128_191_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_191_EXPECTED[] = {
    0xf7, 0x12, 0x2c, 0xbc, 0xec, 0x93, 0xd5, 0x3f,
    0xc7, 0xe3, 0xfc, 0x62, 0x9e, 0xa1, 0x5d, 0x28,
    0x36, 0x3c, 0xad, 0x1c, 0x83, 0xa2, 0x3b, 0xb3,
    0xcc, 0x5e, 0x0c, 0x4a,
};
static const size_t TEST_DVPT128_191_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_191_INPUT[] = {
    0xa2, 0xf5, 0x33, 0x85, 0x61, 0x8b, 0x41, 0x30,
    0x1f, 0x4e, 0x3e, 0xa4, 0xc5, 0x97, 0xf4, 0x11,
    0x10, 0x3d, 0xac, 0x2b, 0x37, 0xab, 0xf5, 0xda,
};
static const size_t TEST_DVPT128_191_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_192_NONCE[] = {
    0x39, 0xd9, 0x3c, 0x3c, 0xf3, 0x1a, 0x6f,
};
static const size_t TEST_DVPT128_192_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_192_ADATA[] = {
    0x93, 0x7d, 0xfa, 0xc5, 0xcd, 0xed, 0x93, 0x84,
    0x38, 0xf4, 0xe9, 0x7a, 0xab, 0xd9, 0xbe, 0xb5,
    0x0d, 0xba, 0x40, 0xf8, 0x24, 0x19, 0x82, 0x60,
    0xa8, 0x97, 0x29, 0x47, 0x9c, 0xfe, 0x68, 0x69,
};
static const size_t TEST_DVPT128_192_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_192_EXPECTED[] = {
    0xe1, 0xca, 0xd7, 0xf9, 0x46, 0xb2, 0x0c, 0x37,
    0x33, 0x23, 0x21, 0x8c, 0x8a, 0x89, 0xe5, 0x6e,
    0xdf, 0x30, 0x30, 0x66, 0x2e, 0x50, 0xd4, 0x59,
    0xfc, 0x12, 0xa5, 0x12,
};
static const size_t TEST_DVPT128_192_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_192_INPUT[] = {
    0xc1, 0xbd, 0xef, 0x96, 0xdc, 0x86, 0x84, 0x46,
    0xbe, 0x48, 0x49, 0x1b, 0x16, 0x05, 0x04, 0x54,
    0x6f, 0x2a, 0x40, 0xdd, 0x58, 0x1f, 0x95, 0x82,
};
static const size_t TEST_DVPT128_192_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_193_NONCE[] = {
    0x0b, 0xbc, 0x17, 0x70, 0x19, 0x32, 0x1e,
};
static const size_t TEST_DVPT128_193_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_193_ADATA[] = {
    0xf6, 0xe0, 0x26, 0x78, 0x82, 0x0f, 0x5c, 0xcb,
    0xed, 0xe6, 0xcb, 0xde, 0xd0, 0x2d, 0x6d, 0xd5,
    0x8d, 0x48, 0x61, 0x66, 0xd7, 0xb1, 0x8e, 0xe9,
    0x75, 0xa6, 0x88, 0xaf, 0x42, 0x1f, 0xb7, 0x95,
};
static const size_t TEST_DVPT128_193_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_193_EXPECTED[] = {
    0xd4, 0x74, 0x18, 0x14, 0x46, 0x6a, 0x23, 0xe2,
    0x61, 0x07, 0xd7, 0x73, 0xf1, 0x03, 0xa4, 0xc8,
    0x3d, 0xb9, 0xd7, 0x72, 0xdb, 0xd5, 0xfd, 0xc1,
    0xc2, 0xea, 0xf8, 0x95,
};
static const size_t TEST_DVPT128_193_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_193_INPUT[] = {
    0x72, 0xa7, 0x09, 0x54, 0xd2, 0x2a, 0xd7, 0x22,
    0xfc, 0x32, 0x75, 0x6a, 0xfc, 0xe6, 0x7b, 0x34,
    0x4b, 0x2f, 0x3c, 0x55, 0xfe, 0x1d, 0x9e, 0xed,
};
static const size_t TEST_DVPT128_193_INPUT_LEN = 24;

/* Alen = 32, Plen = 24, Nlen = 7, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_13_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_13_KEY[] = {
    0xa7, 0xaa, 0x63, 0x5e, 0xa5, 0x1b, 0x0b, 0xb2,
    0x0a, 0x09, 0x2b, 0xd5, 0x57, 0x3e, 0x72, 0x8c,
};
static const size_t TEST_DVPT128_GROUP_13_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_195_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9,
};
static const size_t TEST_DVPT128_195_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_195_ADATA[] = {
    0x37, 0x96, 0xcf, 0x51, 0xb8, 0x72, 0x66, 0x52,
    0xa4, 0x20, 0x47, 0x33, 0xb8, 0xfb, 0xb0, 0x47,
    0xcf, 0x00, 0xfb, 0x91, 0xa9, 0x83, 0x7e, 0x22,
    0xec, 0x22, 0xb1, 0xa2, 0x68, 0xf8, 0x8e, 0x2c,
};
static const size_t TEST_DVPT128_195_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_195_EXPECTED[] = {
    0xb3, 0x51, 0xab, 0x96, 0xb2, 0xe4, 0x55, 0x15,
    0x25, 0x45, 0x58, 0xd5, 0x21, 0x26, 0x73, 0xee,
    0x6c, 0x77, 0x6d, 0x42, 0xdb, 0xca, 0x3b, 0x51,
    0x2c, 0xf3, 0xa2, 0x0b, 0x7f, 0xd7, 0xc4, 0x9e,
    0x6e, 0x79, 0xbe, 0xf4, 0x75, 0xc2, 0x90, 0x6f,
};
static const size_t TEST_DVPT128_195_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_195_INPUT[] = {
    0xa2, 0x65, 0x48, 0x0c, 0xa8, 0x8d, 0x5f, 0x53,
    0x6d, 0xb0, 0xdc, 0x6a, 0xbc, 0x40, 0xfa, 0xf0,
    0xd0, 0x5b, 0xe7, 0xa9, 0x66, 0x97, 0x77, 0x68,
};
static const size_t TEST_DVPT128_195_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_199_NONCE[] = {
    0xcc, 0xee, 0x19, 0xd0, 0x37, 0xcf, 0x4a,
};
static const size_t TEST_DVPT128_199_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_199_ADATA[] = {
    0xc0, 0x26, 0x69, 0x6e, 0x64, 0x25, 0xe6, 0xc3,
    0x3f, 0x45, 0xb4, 0x14, 0x5f, 0xeb, 0xf1, 0x13,
    0x7e, 0x7a, 0xc2, 0x63, 0x83, 0xc9, 0xf5, 0xaa,
    0x4c, 0xd4, 0xe5, 0xe8, 0xab, 0xb1, 0x9e, 0x07,
};
static const size_t TEST_DVPT128_199_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_199_EXPECTED[] = {
    0xe6, 0x76, 0xf5, 0xdf, 0xde, 0x8a, 0xd8, 0x10,
    0xd9, 0xe7, 0x29, 0xd1, 0x42, 0x67, 0x0e, 0xef,
    0x77, 0xf2, 0x87, 0x83, 0x69, 0xa2, 0x87, 0x97,
    0xd5, 0x76, 0x03, 0xd5, 0xc4, 0x56, 0x06, 0xc6,
    0x8b, 0xe5, 0x53, 0x5c, 0x67, 0x1d, 0x54, 0x32,
};
static const size_t TEST_DVPT128_199_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_199_INPUT[] = {
    0x0d, 0xf2, 0x02, 0x43, 0x1e, 0xe7, 0xf2, 0x51,
    0xa3, 0x8a, 0xaf, 0x6a, 0xa8, 0xcd, 0x31, 0x37,
    0x82, 0xbd, 0x29, 0x3a, 0xf9, 0x11, 0x40, 0x05,
};
static const size_t TEST_DVPT128_199_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_206_NONCE[] = {
    0xa8, 0x40, 0xe9, 0x8d, 0xf7, 0x2a, 0xe9,
};
static const size_t TEST_DVPT128_206_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_206_ADATA[] = {
    0x22, 0xc6, 0x60, 0x77, 0x32, 0xef, 0x1b, 0xdc,
    0x7f, 0xcf, 0x61, 0x97, 0xe0, 0x37, 0xcd, 0xad,
    0xd7, 0xee, 0x17, 0xc0, 0x08, 0x55, 0x2d, 0xd9,
    0xf0, 0x4b, 0x85, 0x64, 0xd3, 0x4f, 0xb1, 0x7c,
};
static const size_t TEST_DVPT128_206_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_206_EXPECTED[] = {
    0x1b, 0xcf, 0xf9, 0x40, 0xa2, 0xd9, 0xd4, 0x8e,
    0x93, 0xbb, 0xfd, 0x13, 0xae, 0xd5, 0x94, 0x72,
    0x37, 0x48, 0x59, 0x83, 0xe6, 0xae, 0x04, 0xb8,
    0xb9, 0x44, 0xbb, 0x46, 0x30, 0x6a, 0x9b, 0x1e,
    0x78, 0x3f, 0x3e, 0x54, 0xc9, 0x2d, 0x5f, 0x5e,
};
static const size_t TEST_DVPT128_206_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_206_INPUT[] = {
    0xa2, 0xf5, 0x33, 0x85, 0x61, 0x8b, 0x41, 0x30,
    0x1f, 0x4e, 0x3e, 0xa4, 0xc5, 0x97, 0xf4, 0x11,
    0x10, 0x3d, 0xac, 0x2b, 0x37, 0xab, 0xf5, 0xda,
};
static const size_t TEST_DVPT128_206_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_207_NONCE[] = {
    0x39, 0xd9, 0x3c, 0x3c, 0xf3, 0x1a, 0x6f,
};
static const size_t TEST_DVPT128_207_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_207_ADATA[] = {
    0x93, 0x7d, 0xfa, 0xc5, 0xcd, 0xed, 0x93, 0x84,
    0x38, 0xf4, 0xe9, 0x7a, 0xab, 0xd9, 0xbe, 0xb5,
    0x0d, 0xba, 0x40, 0xf8, 0x24, 0x19, 0x82, 0x60,
    0xa8, 0x97, 0x29, 0x47, 0x9c, 0xfe, 0x68, 0x69,
};
static const size_t TEST_DVPT128_207_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_207_EXPECTED[] = {
    0x3b, 0x6c, 0x15, 0x70, 0xc8, 0x5f, 0x29, 0x70,
    0x79, 0xbe, 0x14, 0xcd, 0x66, 0xd3, 0x35, 0x25,
    0x1c, 0x7b, 0x52, 0xe1, 0x31, 0xa6, 0x36, 0xf1,
    0x48, 0x60, 0x89, 0x63, 0xf3, 0x03, 0x77, 0x63,
    0x84, 0x3b, 0x70, 0xc3, 0x5d, 0x70, 0x11, 0xf8,
};
static const size_t TEST_DVPT128_207_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_207_INPUT[] = {
    0xc1, 0xbd, 0xef, 0x96, 0xdc, 0x86, 0x84, 0x46,
    0xbe, 0x48, 0x49, 0x1b, 0x16, 0x05, 0x04, 0x54,
    0x6f, 0x2a, 0x40, 0xdd, 0x58, 0x1f, 0x95, 0x82,
};
static const size_t TEST_DVPT128_207_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_208_NONCE[] = {
    0x0b, 0xbc, 0x17, 0x70, 0x19, 0x32, 0x1e,
};
static const size_t TEST_DVPT128_208_NONCE_LEN = 7;

static const uint8_t TEST_DVPT128_208_ADATA[] = {
    0xf6, 0xe0, 0x26, 0x78, 0x82, 0x0f, 0x5c, 0xcb,
    0xed, 0xe6, 0xcb, 0xde, 0xd0, 0x2d, 0x6d, 0xd5,
    0x8d, 0x48, 0x61, 0x66, 0xd7, 0xb1, 0x8e, 0xe9,
    0x75, 0xa6, 0x88, 0xaf, 0x42, 0x1f, 0xb7, 0x95,
};
static const size_t TEST_DVPT128_208_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_208_EXPECTED[] = {
    0xb5, 0x40, 0xcd, 0x8c, 0xbe, 0x73, 0x3e, 0x0c,
    0xa2, 0xba, 0x21, 0x12, 0xea, 0x78, 0x55, 0x96,
    0xd2, 0xc1, 0xd7, 0x07, 0xf4, 0x16, 0x08, 0x51,
    0x4b, 0xa2, 0xd0, 0x94, 0x4c, 0x68, 0xcc, 0x36,
    0xd4, 0x12, 0x5b, 0x3e, 0xf9, 0x07, 0x1d, 0x69,
};
static const size_t TEST_DVPT128_208_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_208_INPUT[] = {
    0x72, 0xa7, 0x09, 0x54, 0xd2, 0x2a, 0xd7, 0x22,
    0xfc, 0x32, 0x75, 0x6a, 0xfc, 0xe6, 0x7b, 0x34,
    0x4b, 0x2f, 0x3c, 0x55, 0xfe, 0x1d, 0x9e, 0xed,
};
static const size_t TEST_DVPT128_208_INPUT_LEN = 24;

/* Alen = 32, Plen = 24, Nlen = 13, Tlen = 4 */
static const uint8_t TEST_DVPT128_GROUP_14_MAC_LEN = 4;

static const uint8_t TEST_DVPT128_GROUP_14_KEY[] = {
    0xa7, 0xaa, 0x63, 0x5e, 0xa5, 0x1b, 0x0b, 0xb2,
    0x0a, 0x09, 0x2b, 0xd5, 0x57, 0x3e, 0x72, 0x8c,
};
static const size_t TEST_DVPT128_GROUP_14_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_210_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_210_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_210_ADATA[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
    0xa7, 0xee, 0x64, 0x10, 0x18, 0x4c, 0x79, 0x82,
};
static const size_t TEST_DVPT128_210_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_210_EXPECTED[] = {
    0x93, 0x4f, 0x89, 0x38, 0x24, 0xe8, 0x80, 0xf7,
    0x43, 0xd1, 0x96, 0xb2, 0x2d, 0x1f, 0x34, 0x0a,
    0x52, 0x60, 0x81, 0x55, 0x08, 0x7b, 0xd2, 0x8a,
    0xc2, 0x5e, 0x53, 0x29,
};
static const size_t TEST_DVPT128_210_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_210_INPUT[] = {
    0x87, 0x39, 0xb4, 0xbe, 0xa1, 0xa0, 0x99, 0xfe,
    0x54, 0x74, 0x99, 0xcb, 0xc6, 0xd1, 0xb1, 0x3d,
    0x84, 0x9b, 0x80, 0x84, 0xc9, 0xb6, 0xac, 0xc5,
};
static const size_t TEST_DVPT128_210_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_214_NONCE[] = {
    0xe3, 0xc0, 0x3e, 0xf7, 0xe1, 0xd3, 0x19, 0x61,
    0xee, 0x0b, 0x97, 0xbd, 0x99,
};
static const size_t TEST_DVPT128_214_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_214_ADATA[] = {
    0x8a, 0x36, 0x76, 0xdd, 0x64, 0x08, 0x21, 0xb5,
    0x8f, 0xb0, 0xf0, 0x32, 0x98, 0x55, 0xfd, 0x58,
    0x82, 0xc3, 0x76, 0xea, 0x16, 0x6b, 0x95, 0x8b,
    0x7a, 0xaa, 0xd2, 0x23, 0x05, 0x4e, 0x57, 0x84,
};
static const size_t TEST_DVPT128_214_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_214_EXPECTED[] = {
    0xec, 0xde, 0x42, 0x09, 0x1b, 0xaa, 0x1f, 0x5c,
    0x17, 0xb7, 0x97, 0x46, 0xe2, 0x1c, 0x3d, 0xe5,
    0xc7, 0x89, 0x84, 0x57, 0x07, 0x48, 0x02, 0x1c,
    0xcd, 0x39, 0x95, 0x07,
};
static const size_t TEST_DVPT128_214_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_214_INPUT[] = {
    0x92, 0x97, 0x3c, 0xe7, 0x07, 0x73, 0x3a, 0x73,
    0x11, 0x8c, 0x8c, 0xe6, 0xb5, 0xe3, 0xfc, 0x77,
    0xa1, 0x7f, 0x44, 0x83, 0x10, 0xc0, 0x19, 0x7f,
};
static const size_t TEST_DVPT128_214_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_221_NONCE[] = {
    0x93, 0xe0, 0x88, 0x54, 0x56, 0x0e, 0xdb, 0x09,
    0x6e, 0x5d, 0x65, 0x40, 0x86,
};
static const size_t TEST_DVPT128_221_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_221_ADATA[] = {
    0xbd, 0xc6, 0x0d, 0xff, 0x08, 0xbf, 0xd5, 0xd4,
    0x43, 0x20, 0xb7, 0x5c, 0x61, 0xe4, 0x56, 0xfd,
    0x43, 0x33, 0xc9, 0xc3, 0xd0, 0x29, 0x4d, 0x4a,
    0x48, 0xd9, 0x36, 0xdf, 0xd5, 0x92, 0x2c, 0xe2,
};
static const size_t TEST_DVPT128_221_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_221_EXPECTED[] = {
    0x1f, 0x80, 0x86, 0xa4, 0x3c, 0x1b, 0x2d, 0xea,
    0x55, 0x79, 0x52, 0xdb, 0x88, 0xe0, 0xdb, 0xbd,
    0xb9, 0x6a, 0xaf, 0xdb, 0x34, 0x5e, 0xdd, 0xae,
    0x6c, 0x0b, 0x01, 0x04,
};
static const size_t TEST_DVPT128_221_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_221_INPUT[] = {
    0x56, 0x9e, 0x4a, 0xec, 0x88, 0xdd, 0x51, 0xca,
    0x51, 0x9c, 0x0a, 0x00, 0xc9, 0x22, 0xee, 0x33,
    0xd3, 0x55, 0x9b, 0x98, 0xa3, 0x2d, 0x79, 0x06,
};
static const size_t TEST_DVPT128_221_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_222_NONCE[] = {
    0xe3, 0xf3, 0x7b, 0x68, 0xff, 0x50, 0x8c, 0xfe,
    0x29, 0x54, 0x41, 0xd9, 0xe3,
};
static const size_t TEST_DVPT128_222_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_222_ADATA[] = {
    0xb2, 0xb6, 0xc5, 0x78, 0x2e, 0x4f, 0x12, 0x84,
    0x67, 0xc5, 0x89, 0xd2, 0xa6, 0xcf, 0x55, 0xef,
    0x12, 0x87, 0x7a, 0xdb, 0x77, 0x1b, 0xbb, 0x62,
    0x45, 0xc5, 0xbb, 0xa9, 0xdc, 0xfd, 0x62, 0x08,
};
static const size_t TEST_DVPT128_222_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_222_EXPECTED[] = {
    0xc0, 0xc5, 0xf9, 0x22, 0x85, 0xb1, 0x14, 0xe0,
    0xa0, 0x77, 0x7e, 0x1b, 0xc2, 0x2b, 0x81, 0x0e,
    0x7c, 0xc4, 0xf6, 0x8c, 0x28, 0xcd, 0x5c, 0xe0,
    0x47, 0xa2, 0x8d, 0xd8,
};
static const size_t TEST_DVPT128_222_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_222_INPUT[] = {
    0x02, 0xb5, 0x51, 0x12, 0x04, 0xbd, 0x55, 0xf7,
    0xc3, 0x79, 0x73, 0xe2, 0x6f, 0x6d, 0xf5, 0x88,
    0x3c, 0x0a, 0x53, 0x0f, 0x07, 0xc7, 0xf8, 0xc2,
};
static const size_t TEST_DVPT128_222_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_223_NONCE[] = {
    0xea, 0x98, 0xec, 0x44, 0xf5, 0xa8, 0x67, 0x15,
    0x01, 0x47, 0x83, 0x17, 0x2e,
};
static const size_t TEST_DVPT128_223_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_223_ADATA[] = {
    0xe4, 0x69, 0x2b, 0x9f, 0x06, 0xb6, 0x66, 0xc7,
    0x45, 0x1b, 0x14, 0x6c, 0x8a, 0xeb, 0x07, 0xa6,
    0xe3, 0x0c, 0x62, 0x9d, 0x28, 0x06, 0x5c, 0x3d,
    0xde, 0x59, 0x40, 0x32, 0x5b, 0x14, 0xb8, 0x10,
};
static const size_t TEST_DVPT128_223_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_223_EXPECTED[] = {
    0x56, 0x32, 0x7f, 0x4d, 0xb9, 0xc1, 0x8f, 0x72,
    0xbb, 0xef, 0xc3, 0xf3, 0x16, 0xd3, 0x1f, 0x97,
    0x95, 0xdd, 0x77, 0xf4, 0x93, 0x38, 0x5a, 0xb7,
    0xb7, 0x54, 0x35, 0x52,
};
static const size_t TEST_DVPT128_223_EXPECTED_LEN = 28;

static const uint8_t TEST_DVPT128_223_INPUT[] = {
    0x4d, 0xa4, 0x0b, 0x80, 0x57, 0x9c, 0x1d, 0x9a,
    0x53, 0x09, 0xf7, 0xef, 0xec, 0xb7, 0xc0, 0x59,
    0xa2, 0xf9, 0x14, 0x51, 0x1c, 0xa5, 0xfc, 0x10,
};
static const size_t TEST_DVPT128_223_INPUT_LEN = 24;

/* Alen = 32, Plen = 24, Nlen = 13, Tlen = 16 */
static const uint8_t TEST_DVPT128_GROUP_15_MAC_LEN = 16;

static const uint8_t TEST_DVPT128_GROUP_15_KEY[] = {
    0x26, 0x51, 0x1f, 0xb5, 0x1f, 0xcf, 0xa7, 0x5c,
    0xb4, 0xb4, 0x4d, 0xa7, 0x5a, 0x6e, 0x5a, 0x0e,
};
static const size_t TEST_DVPT128_GROUP_15_KEY_LEN = 16;

static const uint8_t TEST_DVPT128_225_NONCE[] = {
    0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40,
    0x3a, 0xff, 0x85, 0x9f, 0xbb,
};
static const size_t TEST_DVPT128_225_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_225_ADATA[] = {
    0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71,
    0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
    0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97,
    0xa7, 0xee, 0x64, 0x10, 0x18, 0x4c, 0x79, 0x82,
};
static const size_t TEST_DVPT128_225_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_225_EXPECTED[] = {
    0x50, 0x03, 0x8b, 0x5f, 0xdd, 0x36, 0x4e, 0xe7,
    0x47, 0xb7, 0x0d, 0x00, 0xbd, 0x36, 0x84, 0x0e,
    0xce, 0x4e, 0xa1, 0x99, 0x98, 0x12, 0x33, 0x75,
    0xc0, 0xa4, 0x58, 0xbf, 0xca, 0xfa, 0x3b, 0x26,
    0x09, 0xaf, 0xe0, 0xf8, 0x25, 0xcb, 0xf5, 0x03,
};
static const size_t TEST_DVPT128_225_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_225_INPUT[] = {
    0x87, 0x39, 0xb4, 0xbe, 0xa1, 0xa0, 0x99, 0xfe,
    0x54, 0x74, 0x99, 0xcb, 0xc6, 0xd1, 0xb1, 0x3d,
    0x84, 0x9b, 0x80, 0x84, 0xc9, 0xb6, 0xac, 0xc5,
};
static const size_t TEST_DVPT128_225_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_229_NONCE[] = {
    0xe3, 0xc0, 0x3e, 0xf7, 0xe1, 0xd3, 0x19, 0x61,
    0xee, 0x0b, 0x97, 0xbd, 0x99,
};
static const size_t TEST_DVPT128_229_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_229_ADATA[] = {
    0x8a, 0x36, 0x76, 0xdd, 0x64, 0x08, 0x21, 0xb5,
    0x8f, 0xb0, 0xf0, 0x32, 0x98, 0x55, 0xfd, 0x58,
    0x82, 0xc3, 0x76, 0xea, 0x16, 0x6b, 0x95, 0x8b,
    0x7a, 0xaa, 0xd2, 0x23, 0x05, 0x4e, 0x57, 0x84,
};
static const size_t TEST_DVPT128_229_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_229_EXPECTED[] = {
    0xc6, 0xb7, 0x68, 0x0f, 0x32, 0x11, 0x32, 0xa8,
    0xbd, 0x00, 0xe8, 0xe9, 0x2f, 0x78, 0x5d, 0x0b,
    0x82, 0x8b, 0x10, 0x0a, 0xf6, 0x39, 0x2a, 0x04,
    0xd1, 0x29, 0x23, 0x73, 0xa7, 0x69, 0x70, 0xed,
    0xa7, 0x7a, 0x81, 0x94, 0xf6, 0x27, 0x62, 0x62,
};
static const size_t TEST_DVPT128_229_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_229_INPUT[] = {
    0x92, 0x97, 0x3c, 0xe7, 0x07, 0x73, 0x3a, 0x73,
    0x11, 0x8c, 0x8c, 0xe6, 0xb5, 0xe3, 0xfc, 0x77,
    0xa1, 0x7f, 0x44, 0x83, 0x10, 0xc0, 0x19, 0x7f,
};
static const size_t TEST_DVPT128_229_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_236_NONCE[] = {
    0x93, 0xe0, 0x88, 0x54, 0x56, 0x0e, 0xdb, 0x09,
    0x6e, 0x5d, 0x65, 0x40, 0x86,
};
static const size_t TEST_DVPT128_236_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_236_ADATA[] = {
    0xbd, 0xc6, 0x0d, 0xff, 0x08, 0xbf, 0xd5, 0xd4,
    0x43, 0x20, 0xb7, 0x5c, 0x61, 0xe4, 0x56, 0xfd,
    0x43, 0x33, 0xc9, 0xc3, 0xd0, 0x29, 0x4d, 0x4a,
    0x48, 0xd9, 0x36, 0xdf, 0xd5, 0x92, 0x2c, 0xe2,
};
static const size_t TEST_DVPT128_236_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_236_EXPECTED[] = {
    0x7f, 0xcd, 0xce, 0x0b, 0xa5, 0x67, 0xb9, 0xa7,
    0x08, 0xd5, 0x4f, 0xdb, 0x16, 0x12, 0x5d, 0xe7,
    0x1d, 0xce, 0x95, 0x2f, 0x47, 0x41, 0x68, 0x4f,
    0x4f, 0x9d, 0x30, 0x2e, 0x4f, 0x1d, 0x2a, 0x2a,
    0xed, 0xf2, 0x76, 0x8d, 0x7b, 0x29, 0x16, 0x3f,
};
static const size_t TEST_DVPT128_236_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_236_INPUT[] = {
    0x56, 0x9e, 0x4a, 0xec, 0x88, 0xdd, 0x51, 0xca,
    0x51, 0x9c, 0x0a, 0x00, 0xc9, 0x22, 0xee, 0x33,
    0xd3, 0x55, 0x9b, 0x98, 0xa3, 0x2d, 0x79, 0x06,
};
static const size_t TEST_DVPT128_236_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_237_NONCE[] = {
    0xe3, 0xf3, 0x7b, 0x68, 0xff, 0x50, 0x8c, 0xfe,
    0x29, 0x54, 0x41, 0xd9, 0xe3,
};
static const size_t TEST_DVPT128_237_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_237_ADATA[] = {
    0xb2, 0xb6, 0xc5, 0x78, 0x2e, 0x4f, 0x12, 0x84,
    0x67, 0xc5, 0x89, 0xd2, 0xa6, 0xcf, 0x55, 0xef,
    0x12, 0x87, 0x7a, 0xdb, 0x77, 0x1b, 0xbb, 0x62,
    0x45, 0xc5, 0xbb, 0xa9, 0xdc, 0xfd, 0x62, 0x08,
};
static const size_t TEST_DVPT128_237_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_237_EXPECTED[] = {
    0xd4, 0x21, 0x11, 0xba, 0x22, 0x98, 0x7e, 0xac,
    0x1e, 0xad, 0x5c, 0xc6, 0xcb, 0x85, 0x48, 0xbc,
    0xda, 0x19, 0x0d, 0x11, 0x8d, 0xcd, 0x54, 0x61,
    0xa5, 0x00, 0x36, 0xaf, 0x67, 0xfa, 0xda, 0xb1,
    0x63, 0xe9, 0xda, 0xa8, 0xbd, 0x8e, 0x90, 0x30,
};
static const size_t TEST_DVPT128_237_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_237_INPUT[] = {
    0x02, 0xb5, 0x51, 0x12, 0x04, 0xbd, 0x55, 0xf7,
    0xc3, 0x79, 0x73, 0xe2, 0x6f, 0x6d, 0xf5, 0x88,
    0x3c, 0x0a, 0x53, 0x0f, 0x07, 0xc7, 0xf8, 0xc2,
};
static const size_t TEST_DVPT128_237_INPUT_LEN = 24;

static const uint8_t TEST_DVPT128_238_NONCE[] = {
    0xea, 0x98, 0xec, 0x44, 0xf5, 0xa8, 0x67, 0x15,
    0x01, 0x47, 0x83, 0x17, 0x2e,
};
static const size_t TEST_DVPT128_238_NONCE_LEN = 13;

static const uint8_t TEST_DVPT128_238_ADATA[] = {
    0xe4, 0x69, 0x2b, 0x9f, 0x06, 0xb6, 0x66, 0xc7,
    0x45, 0x1b, 0x14, 0x6c, 0x8a, 0xeb, 0x07, 0xa6,
    0xe3, 0x0c, 0x62, 0x9d, 0x28, 0x06, 0x5c, 0x3d,
    0xde, 0x59, 0x40, 0x32, 0x5b, 0x14, 0xb8, 0x10,
};
static const size_t TEST_DVPT128_238_ADATA_LEN = 32;

static const uint8_t TEST_DVPT128_238_EXPECTED[] = {
    0x1b, 0xf0, 0xba, 0x0e, 0xbb, 0x20, 0xd8, 0xed,
    0xba, 0x59, 0xf2, 0x9a, 0x93, 0x71, 0x75, 0x0c,
    0x9c, 0x71, 0x40, 0x78, 0xf7, 0x3c, 0x33, 0x5d,
    0x2f, 0x13, 0x22, 0xac, 0x69, 0xb8, 0x48, 0xb0,
    0x01, 0x47, 0x63, 0x23, 0xae, 0xd8, 0x4c, 0x47,
};
static const size_t TEST_DVPT128_238_EXPECTED_LEN = 40;

static const uint8_t TEST_DVPT128_238_INPUT[] = {
    0x4d, 0xa4, 0x0b, 0x80, 0x57, 0x9c, 0x1d, 0x9a,
    0x53, 0x09, 0xf7, 0xef, 0xec, 0xb7, 0xc0, 0x59,
    0xa2, 0xf9, 0x14, 0x51, 0x1c, 0xa5, 0xfc, 0x10,
};
static const size_t TEST_DVPT128_238_INPUT_LEN = 24;

/* Share test buffer output */
static uint8_t data[512];

static void test_encrypt_op(const uint8_t *key, uint8_t key_len,
                            const uint8_t *adata, size_t adata_len,
                            const uint8_t *nonce, uint8_t nonce_len,
                            const uint8_t *plain, size_t plain_len,
                            const uint8_t *output_expected,
                            size_t output_expected_len,
                            uint8_t mac_length)
{
    cipher_t cipher;
    int len, err, cmp;
    size_t len_encoding = nonce_and_len_encoding_size - nonce_len;

    TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
                        "Output buffer too small");

    err = cipher_init(&cipher, CIPHER_AES_128, key, key_len);
    TEST_ASSERT_EQUAL_INT(1, err);

    len = cipher_encrypt_ccm(&cipher, adata, adata_len,
                             mac_length, len_encoding,
                             nonce, nonce_len, plain, plain_len, data);
    TEST_ASSERT_MESSAGE(len > 0, "Encryption failed");

    TEST_ASSERT_EQUAL_INT(output_expected_len, len);
    cmp = compare(output_expected, data, len);
    TEST_ASSERT_MESSAGE(1 == cmp, "wrong ciphertext");
}

static void test_decrypt_op(const uint8_t *key, uint8_t key_len,
                            const uint8_t *adata, size_t adata_len,
                            const uint8_t *nonce, uint8_t nonce_len,
                            const uint8_t *encrypted, size_t encrypted_len,
                            const uint8_t *output_expected,
                            size_t output_expected_len,
                            uint8_t mac_length)
{
    cipher_t cipher;
    int len, err, cmp;
    size_t len_encoding = nonce_and_len_encoding_size - nonce_len;

    TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len,
                        "Output buffer too small");

    err = cipher_init(&cipher, CIPHER_AES_128, key, key_len);
    TEST_ASSERT_EQUAL_INT(1, err);

    len = cipher_decrypt_ccm(&cipher, adata, adata_len,
                             mac_length, len_encoding,
                             nonce, nonce_len, encrypted, encrypted_len, data);
    TEST_ASSERT_MESSAGE(len >= 0, "Decryption failed");

    TEST_ASSERT_EQUAL_INT(output_expected_len, len);
    cmp = compare(output_expected, data, len);
    TEST_ASSERT_MESSAGE(1 == cmp, "wrong ciphertext");

}

#define do_test_encrypt_op(prefix, test_num, group_num) do { \
        test_encrypt_op(TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY, \
                        TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _ADATA, \
                        TEST_ ## prefix ## _ ## test_num ## _ADATA_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _NONCE, \
                        TEST_ ## prefix ## _ ## test_num ## _NONCE_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _INPUT, \
                        TEST_ ## prefix ## _ ## test_num ## _INPUT_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _EXPECTED, \
                        TEST_ ## prefix ## _ ## test_num ## _EXPECTED_LEN, \
                        TEST_ ## prefix ## _GROUP_ ## group_num ## _MAC_LEN \
                        ); \
} while (0)

#define do_test_decrypt_op(prefix, test_num, group_num) do { \
        test_decrypt_op(TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY, \
                        TEST_ ## prefix ## _GROUP_ ## group_num ## _KEY_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _ADATA, \
                        TEST_ ## prefix ## _ ## test_num ## _ADATA_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _NONCE, \
                        TEST_ ## prefix ## _ ## test_num ## _NONCE_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _EXPECTED, \
                        TEST_ ## prefix ## _ ## test_num ## _EXPECTED_LEN, \
                        TEST_ ## prefix ## _ ## test_num ## _INPUT, \
                        TEST_ ## prefix ## _ ## test_num ## _INPUT_LEN, \
                        TEST_ ## prefix ## _GROUP_ ## group_num ## _MAC_LEN \
                        ); \
} while (0)

static void test_crypto_modes_ccm_decrypt(void)
{
    do_test_decrypt_op(DVPT128, 0, 0);
    do_test_decrypt_op(DVPT128, 4, 0);
    do_test_decrypt_op(DVPT128, 11, 0);
    do_test_decrypt_op(DVPT128, 12, 0);
    do_test_decrypt_op(DVPT128, 13, 0);
    do_test_decrypt_op(DVPT128, 15, 1);
    do_test_decrypt_op(DVPT128, 19, 1);
    do_test_decrypt_op(DVPT128, 26, 1);
    do_test_decrypt_op(DVPT128, 27, 1);
    do_test_decrypt_op(DVPT128, 28, 1);
    do_test_decrypt_op(DVPT128, 30, 2);
    do_test_decrypt_op(DVPT128, 34, 2);
    do_test_decrypt_op(DVPT128, 41, 2);
    do_test_decrypt_op(DVPT128, 42, 2);
    do_test_decrypt_op(DVPT128, 43, 2);
    do_test_decrypt_op(DVPT128, 45, 3);
    do_test_decrypt_op(DVPT128, 49, 3);
    do_test_decrypt_op(DVPT128, 56, 3);
    do_test_decrypt_op(DVPT128, 57, 3);
    do_test_decrypt_op(DVPT128, 58, 3);
    do_test_decrypt_op(DVPT128, 60, 4);
    do_test_decrypt_op(DVPT128, 64, 4);
    do_test_decrypt_op(DVPT128, 71, 4);
    do_test_decrypt_op(DVPT128, 72, 4);
    do_test_decrypt_op(DVPT128, 73, 4);
    do_test_decrypt_op(DVPT128, 75, 5);
    do_test_decrypt_op(DVPT128, 79, 5);
    do_test_decrypt_op(DVPT128, 86, 5);
    do_test_decrypt_op(DVPT128, 87, 5);
    do_test_decrypt_op(DVPT128, 88, 5);
    do_test_decrypt_op(DVPT128, 90, 6);
    do_test_decrypt_op(DVPT128, 94, 6);
    do_test_decrypt_op(DVPT128, 101, 6);
    do_test_decrypt_op(DVPT128, 102, 6);
    do_test_decrypt_op(DVPT128, 103, 6);
    do_test_decrypt_op(DVPT128, 105, 7);
    do_test_decrypt_op(DVPT128, 109, 7);
    do_test_decrypt_op(DVPT128, 116, 7);
    do_test_decrypt_op(DVPT128, 117, 7);
    do_test_decrypt_op(DVPT128, 118, 7);
    do_test_decrypt_op(DVPT128, 120, 8);
    do_test_decrypt_op(DVPT128, 124, 8);
    do_test_decrypt_op(DVPT128, 131, 8);
    do_test_decrypt_op(DVPT128, 132, 8);
    do_test_decrypt_op(DVPT128, 133, 8);
    do_test_decrypt_op(DVPT128, 135, 9);
    do_test_decrypt_op(DVPT128, 139, 9);
    do_test_decrypt_op(DVPT128, 146, 9);
    do_test_decrypt_op(DVPT128, 147, 9);
    do_test_decrypt_op(DVPT128, 148, 9);
    do_test_decrypt_op(DVPT128, 150, 10);
    do_test_decrypt_op(DVPT128, 154, 10);
    do_test_decrypt_op(DVPT128, 161, 10);
    do_test_decrypt_op(DVPT128, 162, 10);
    do_test_decrypt_op(DVPT128, 163, 10);
    do_test_decrypt_op(DVPT128, 165, 11);
    do_test_decrypt_op(DVPT128, 169, 11);
    do_test_decrypt_op(DVPT128, 176, 11);
    do_test_decrypt_op(DVPT128, 177, 11);
    do_test_decrypt_op(DVPT128, 178, 11);
    do_test_decrypt_op(DVPT128, 180, 12);
    do_test_decrypt_op(DVPT128, 184, 12);
    do_test_decrypt_op(DVPT128, 191, 12);
    do_test_decrypt_op(DVPT128, 192, 12);
    do_test_decrypt_op(DVPT128, 193, 12);
    do_test_decrypt_op(DVPT128, 195, 13);
    do_test_decrypt_op(DVPT128, 199, 13);
    do_test_decrypt_op(DVPT128, 206, 13);
    do_test_decrypt_op(DVPT128, 207, 13);
    do_test_decrypt_op(DVPT128, 208, 13);
    do_test_decrypt_op(DVPT128, 210, 14);
    do_test_decrypt_op(DVPT128, 214, 14);
    do_test_decrypt_op(DVPT128, 221, 14);
    do_test_decrypt_op(DVPT128, 222, 14);
    do_test_decrypt_op(DVPT128, 223, 14);
    do_test_decrypt_op(DVPT128, 225, 15);
    do_test_decrypt_op(DVPT128, 229, 15);
    do_test_decrypt_op(DVPT128, 236, 15);
    do_test_decrypt_op(DVPT128, 237, 15);
    do_test_decrypt_op(DVPT128, 238, 15);
}
static void test_crypto_modes_ccm_encrypt(void)
{
    do_test_encrypt_op(DVPT128, 0, 0);
    do_test_encrypt_op(DVPT128, 4, 0);
    do_test_encrypt_op(DVPT128, 11, 0);
    do_test_encrypt_op(DVPT128, 12, 0);
    do_test_encrypt_op(DVPT128, 13, 0);
    do_test_encrypt_op(DVPT128, 15, 1);
    do_test_encrypt_op(DVPT128, 19, 1);
    do_test_encrypt_op(DVPT128, 26, 1);
    do_test_encrypt_op(DVPT128, 27, 1);
    do_test_encrypt_op(DVPT128, 28, 1);
    do_test_encrypt_op(DVPT128, 30, 2);
    do_test_encrypt_op(DVPT128, 34, 2);
    do_test_encrypt_op(DVPT128, 41, 2);
    do_test_encrypt_op(DVPT128, 42, 2);
    do_test_encrypt_op(DVPT128, 43, 2);
    do_test_encrypt_op(DVPT128, 45, 3);
    do_test_encrypt_op(DVPT128, 49, 3);
    do_test_encrypt_op(DVPT128, 56, 3);
    do_test_encrypt_op(DVPT128, 57, 3);
    do_test_encrypt_op(DVPT128, 58, 3);
    do_test_encrypt_op(DVPT128, 60, 4);
    do_test_encrypt_op(DVPT128, 64, 4);
    do_test_encrypt_op(DVPT128, 71, 4);
    do_test_encrypt_op(DVPT128, 72, 4);
    do_test_encrypt_op(DVPT128, 73, 4);
    do_test_encrypt_op(DVPT128, 75, 5);
    do_test_encrypt_op(DVPT128, 79, 5);
    do_test_encrypt_op(DVPT128, 86, 5);
    do_test_encrypt_op(DVPT128, 87, 5);
    do_test_encrypt_op(DVPT128, 88, 5);
    do_test_encrypt_op(DVPT128, 90, 6);
    do_test_encrypt_op(DVPT128, 94, 6);
    do_test_encrypt_op(DVPT128, 101, 6);
    do_test_encrypt_op(DVPT128, 102, 6);
    do_test_encrypt_op(DVPT128, 103, 6);
    do_test_encrypt_op(DVPT128, 105, 7);
    do_test_encrypt_op(DVPT128, 109, 7);
    do_test_encrypt_op(DVPT128, 116, 7);
    do_test_encrypt_op(DVPT128, 117, 7);
    do_test_encrypt_op(DVPT128, 118, 7);
    do_test_encrypt_op(DVPT128, 120, 8);
    do_test_encrypt_op(DVPT128, 124, 8);
    do_test_encrypt_op(DVPT128, 131, 8);
    do_test_encrypt_op(DVPT128, 132, 8);
    do_test_encrypt_op(DVPT128, 133, 8);
    do_test_encrypt_op(DVPT128, 135, 9);
    do_test_encrypt_op(DVPT128, 139, 9);
    do_test_encrypt_op(DVPT128, 146, 9);
    do_test_encrypt_op(DVPT128, 147, 9);
    do_test_encrypt_op(DVPT128, 148, 9);
    do_test_encrypt_op(DVPT128, 150, 10);
    do_test_encrypt_op(DVPT128, 154, 10);
    do_test_encrypt_op(DVPT128, 161, 10);
    do_test_encrypt_op(DVPT128, 162, 10);
    do_test_encrypt_op(DVPT128, 163, 10);
    do_test_encrypt_op(DVPT128, 165, 11);
    do_test_encrypt_op(DVPT128, 169, 11);
    do_test_encrypt_op(DVPT128, 176, 11);
    do_test_encrypt_op(DVPT128, 177, 11);
    do_test_encrypt_op(DVPT128, 178, 11);
    do_test_encrypt_op(DVPT128, 180, 12);
    do_test_encrypt_op(DVPT128, 184, 12);
    do_test_encrypt_op(DVPT128, 191, 12);
    do_test_encrypt_op(DVPT128, 192, 12);
    do_test_encrypt_op(DVPT128, 193, 12);
    do_test_encrypt_op(DVPT128, 195, 13);
    do_test_encrypt_op(DVPT128, 199, 13);
    do_test_encrypt_op(DVPT128, 206, 13);
    do_test_encrypt_op(DVPT128, 207, 13);
    do_test_encrypt_op(DVPT128, 208, 13);
    do_test_encrypt_op(DVPT128, 210, 14);
    do_test_encrypt_op(DVPT128, 214, 14);
    do_test_encrypt_op(DVPT128, 221, 14);
    do_test_encrypt_op(DVPT128, 222, 14);
    do_test_encrypt_op(DVPT128, 223, 14);
    do_test_encrypt_op(DVPT128, 225, 15);
    do_test_encrypt_op(DVPT128, 229, 15);
    do_test_encrypt_op(DVPT128, 236, 15);
    do_test_encrypt_op(DVPT128, 237, 15);
    do_test_encrypt_op(DVPT128, 238, 15);
}

Test *tests_crypto_modes_ccm_tests_128(void)
{
    EMB_UNIT_TESTFIXTURES(fixtures) {
        new_TestFixture(test_crypto_modes_ccm_encrypt),
        new_TestFixture(test_crypto_modes_ccm_decrypt),
    };

    EMB_UNIT_TESTCALLER(crypto_modes_ccm_tests_128, NULL, NULL, fixtures);

    return (Test *)&crypto_modes_ccm_tests_128;
}
